﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Yugi.Client;
using Yugi.Client.Control;

namespace Yugi_Gui
{
	/// <summary>
	/// Interaction logic for TombChoices.xaml
	/// </summary>
	public partial class TombChoices : UserControl
	{
		public TombChoices()
		{
			this.InitializeComponent();
		}
        public void Add(CardModel source)
        {
            HandImage img = new HandImage();
            img.MouseEnter += new MouseEventHandler(img_MouseEnter);
            img.img.Source = source.YCard.displayImage;
            img.Width = 80;
            img.Height = 100;
            img.Margin = new Thickness(2,0,0,0);
            img.DataContext = source;
            this.stack.Children.Add(img);
        }
        void img_MouseEnter(object sender, MouseEventArgs e)
        {
            HandImage img = sender as HandImage;
            ((CardModel)img.DataContext).YSupervisorModel.ReceiveMessageFromChildren(ClientMSG.PrintCard, ((CardModel)img.DataContext).YCard);
        }
        public void Clear()
        {
            this.stack.Children.Clear();
        }
        public UIElementCollection GetListChild()
        {
            return this.stack.Children;
        }
	}
}